package com.plate.common.core.result;

import lombok.Data;

import java.util.Date;

/**
 * @ClassName ResultCode
 * @Description 返回对象状态码
 * @Author jiaxd
 * @Date 2023年10月17日 23:17
 * @Version 1.0
 */


public enum ResultCode {

    SUCCESS(true, 200, "操作成功！", (new Date()).getTime()),

    FAIL(false, 400, "操作失败", (new Date()).getTime()),

    UNAUTHENTICATED(false, 3, "您还未登录", (new Date()).getTime()),

    UNAUTHORISE(false, 4, "权限不足", (new Date()).getTime()),

    SERVER_ERROR(false, 5, "抱歉，系统繁忙，请稍后重试！", (new Date()).getTime()),

    UNAUTHORIZED(false, 401, "系统错误!", (new Date()).getTime()),

    INVALID_TOKEN(false, 1004, "无效的token", (new Date()).getTime()),

    UNSUPPORTED_GRANT_TYPE(false, 1003, "不支持的认证模式", (new Date().getTime())),

    USERNAME_OR_PASSWORD_ERROR(false, 1002, "用户名或密码错误", (new Date().getTime())),

    CLIENT_AUTHENTICATION_FAILED(false,1001,"客户端认证失败", (new Date().getTime())),

    MOBILEORPASSWORDERROR(false,20001, "用户名或密码错误", (new Date()).getTime());


    /**
     * 请求是否成功
     */
    boolean success;

    /**
     * 状态码
     */
    int code;

    /**
     * 信息
     */
    String mesg;

    /**
     * 时间戳
     */
    Long time;

    ResultCode(boolean success, int code, String mesg, Long time) {
        this.success = success;
        this.code = code;
        this.mesg = mesg;
        this.time = time;
    }

    ResultCode() {
    }

}

